package { 
	import mx.controls.Label; 
	import mx.controls.DataGrid; 
	import mx.controls.dataGridClasses.*; 
	import flash.display.Graphics; 
	
	public class CustomBackgroundComp extends Label { 
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void 
		{ 
			super.updateDisplayList(unscaledWidth, unscaledHeight); 
			var g:Graphics = graphics; 
			g.clear(); 
			var grid1:DataGrid = DataGrid(DataGridListData(listData).owner); 
			/*	if (grid1.isItemSelected(data) || grid1.isItemHighlighted(data)) 
			return;  */
			if (data[DataGridListData(listData).dataField] == 0){ 
				g.beginFill(0x00EE00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 1){ 
				g.beginFill(0xFFFF00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 2){ 
				g.beginFill(0xFF4500); 
			} 
			else if (data[DataGridListData(listData).dataField] == 3){ 
				g.beginFill(0xFF0033); 
			} 
			else if (data[DataGridListData(listData).dataField] == 4) { 
				g.beginFill(0xCC1100); 
			} 
			else if (data[DataGridListData(listData).dataField] == 5) { 
				g.beginFill(0x8B1C62); 
			} 
			else if (data[DataGridListData(listData).dataField] == 6) { 
				g.beginFill(0x120A8F); 
			} 
			g.drawRect(0, 0, unscaledWidth, unscaledHeight); g.endFill(); 
		} 
	} 
}